<?php
$portfolioData = $this->PortfolioData;
//Zend_Debug::dump($this->get_id);exit();
if ($this->get_id == 0) {
?>
    <div class="contentcontainer">
        <div class="headings altheading">
            <h2>Services</h2>
        </div>

        <div class="contentbox">
            <div align="left">
                <a href="http://<?php echo $_SERVER['HTTP_HOST'] . '/control/'.$this->controller.'/add/'; ?>"><img src="/img/icons/2.png" alt="" />New article</a>&nbsp;&nbsp;&nbsp;&nbsp;
                <a href="/control/sub-page/add-pages/"><img src="/img/icons/42.png" alt="" />New subpage</a>
            </div>
            <table width="100%">
                <thead>
                    <tr>
                        <th>Project name</th>
                        <th>Case study</th>
                        <th>Actions</th>
                    </tr>
                </thead>
                <tbody>
<?php foreach ($portfolioData as $row) { ?>
                <tr class="alt">
                    <td><?php echo $row['name']; ?></td>
                    <td><?php echo substr($row['text'], 0, 70) . ' ...'; ?></td>
                    <td>
                        <a href="http://<?php echo $_SERVER['HTTP_HOST'] . '/control/services/edit/id/' . $row['id']; ?>" title=""><img SRC="/img/icons/icon_edit.png" alt="Edit" /></a>&nbsp;&nbsp;&nbsp;
                        <a href="http://<?php echo $_SERVER['HTTP_HOST'] . '/control/services/edit/id/' . $row['id'] . '/del/1/'; ?>" title=""><img SRC="/img/icons/icon_delete.png" alt="Delete" /></a>
                    </td>
                </tr>
<?php } ?>
            </tbody>
        </table>
            <div style="clear: both;"></div>
    </div>

</div>

<div class="contentcontainer">
    <div class="headings alt">
        <h2>Foot module editor:</h2>
    </div>
    <div class="contentbox">

<?php echo $this->formContent; ?>
    </div>

</div>

<?php } elseif ($this->get_id > 0 && $this->get_del == 0) { ?>
    <div class="contentcontainer">
        <div class="headings alt">
            <h2>Editing...</h2>
        </div>
        <div class="contentbox">
<?php echo $this->form; ?>
    </div>
</div>
<?php } elseif ($this->get_id > 0 && $this->get_del == 1) { ?>
    <div class="contentcontainer">
        <div class="headings alt">
            <h2>Deleting...</h2>
        </div>
        <div class="contentbox" align="center">
            Are you sure want to delete:
            <H1><?php echo $this->NameToDelete['name']; ?> ?</H1><br>
            <form action="<?php echo $this->url(array('module' => 'control', 'controller' => 'services', 'action' => 'edit')); ?>" method="post">
                <input type="hidden" name="id" value="<?php echo $this->NameToDelete['id']; ?>" />
                <input type="submit" name="del" value="<?php echo $this->yesButton; ?>" class="btn" />
                <input type="submit" name="del" value="<?php echo $this->noButton; ?>" class="btn" />
            </form>
        </div>
    </div>
<?php } else {

} ?>